package functional_thinking;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class T2 {
	
	public static void main(String[] args) {
		List<String> keys = Map.of( "a", 1, 
									"b", 4, 
									"x", 7, 
									"d", 9, 
									"e", 2 
				)
		.entrySet()
		.stream()
		.sorted((o1, o2) -> Integer.compare(o1.getValue(), o2.getValue()))
		.map(e -> e.getKey())
		.collect(Collectors.toList());
		
		keys.forEach(System.out::println);
	}

}
